/* Nascondi il pulsante Sign In quando l'utente è loggato */
.user-logged-in .sign-in-btn {
    display: none !important;
}

/* Stili per il sistema di autenticazione */

/* Pulsante Sign In - Stili base (sovrascrive gli stili in header.css se necessario) */
.sign-in-btn {
    /* Gli stili principali sono definiti in header.css */
    margin-right: 1vh;
    text-decoration: none;
    outline: none;
}

.sign-in-btn:focus {
    outline: none;
    text-decoration: none;
}

/* Modal di Login */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.login-modal.closing {
    animation: fadeOut 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        background-color: rgba(0, 0, 0, 0);
    }
    to {
        opacity: 1;
        background-color: rgba(0, 0, 0, 0.8);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        background-color: rgba(0, 0, 0, 0.8);
    }
    to {
        opacity: 0;
        background-color: rgba(0, 0, 0, 0);
    }
}

.login-content {
    background-color: #1a1a1a;
    border-radius: 2vh;
    padding: 3vh;
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid #444243;
    animation: slideIn 0.3s ease-out;
}

.login-modal.closing .login-content {
    animation: slideOut 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-30px);
        opacity: 0;
    }
}

.login-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2vh;
}

.login-header h2 {
    color: #c9c9c9;
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: #c9c9c9;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 3vh;
    height: 3vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #fff;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5vh;
}

.form-group label {
    color: #c9c9c9;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input {
    background-color: #2a2a2a;
    border: 1px solid #444243;
    border-radius: 0.5vh;
    color: #c9c9c9;
    padding: 1vh;
    font-size: 1rem;
    font-family: 'Montserrat-Alt1', sans-serif;
}

.form-group input:focus {
    outline: none;
    border-color: #666565;
    background-color: #333333;
}

.login-submit-btn {
    background-color: #131313;
    color: #c9c9c9;
    border: 1px solid #444243;
    border-radius: 1vh;
    padding: 1.2vh 2vh;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat-Alt1', sans-serif;
    margin-top: 1.5vh;
    width: 100%;
}

.login-submit-btn:hover {
    background-color: #494949;
    border-color: #666565;
    transform: translateY(-1px);
}

.login-footer {
    margin-top: 2vh;
    text-align: center;
}

.forgot-password {
    color: #999;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #c9c9c9;
}

.register-link {
    color: #c9c9c9;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.register-link:hover {
    color: #fff;
}

.login-footer p {
    color: #999;
    font-size: 0.9rem;
    margin-top: 1vh;
}

.login-error {
    color: #ff4444;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 1vh;
}

.demo-info {
    margin-top: 2vh;
    padding: 1.5vh;
    background-color: #2a2a2a;
    border-radius: 1vh;
    border: 1px solid #444243;
}

.demo-info p {
    margin: 0.5vh 0;
    font-size: 0.85rem;
    color: #999;
}

.demo-info strong {
    color: #c9c9c9;
}

.register-link {
    text-align: center;
    margin-top: 2vh;
    color: #999;
    font-size: 0.9rem;
}

.register-link a {
    color: #c9c9c9;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.register-link a:hover {
    color: #fff;
}

/* Dropdown Profilo */
.profile-dropdown {
    position: fixed;
    background-color: #1a1a1a;
    border: 1px solid #444243;
    border-radius: 1vh;
    padding: 1vh;
    margin-top: 0.5vh;
    min-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 1vh;
    padding: 1vh;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    background-color: #494949;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #c9c9c9;
    font-size: 1rem;
}

.profile-details {
    flex: 1;
}

.profile-name {
    color: #c9c9c9;
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.2vh;
}

.profile-username {
    color: #999;
    font-size: 0.9rem;
}

.dropdown-divider {
    border: none;
    height: 1px;
    background-color: #444243;
    margin: 1vh 0;
}

.profile-menu {
    display: flex;
    flex-direction: column;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1vh;
    padding: 1vh;
    color: #c9c9c9;
    text-decoration: none;
    border-radius: 0.5vh;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.menu-item:hover {
    background-color: #2a2a2a;
}

.menu-item svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.logout-item {
    color: #ff6b6b;
}

.logout-item:hover {
    background-color: rgba(255, 107, 107, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .login-content {
        width: 95%;
        padding: 2vh;
    }
    
    .login-header h2 {
        font-size: 1.2rem;
    }
    
    /* Pannello profilo centrato e ingrandito per mobile */
    .profile-dropdown {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        min-width: 85vw;
        max-width: 350px;
        padding: 3vh 2.5vh;
        border-radius: 2vh;
        background-color: rgba(26, 26, 26, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 15px 60px rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 3000;
    }
    
    /* Informazioni profilo più grandi */
    .profile-info {
        padding: 2vh;
        gap: 2vh;
    }
    
    .profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .profile-name {
        font-size: 1.3rem;
        margin-bottom: 0.5vh;
    }
    
    .profile-username {
        font-size: 1rem;
    }
    
    /* Menu items più grandi per tocco facile */
    .menu-item {
        padding: 2vh 1.5vh;
        font-size: 1.1rem;
        gap: 1.5vh;
        border-radius: 1vh;
    }
    
    .menu-item svg {
        width: 20px;
        height: 20px;
    }
    
    /* Divider più prominente */
    .dropdown-divider {
        margin: 2vh 0;
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .sign-in-btn {
        font-size: 0.9rem;
        padding: 0.4vh 0.8vh;
    }
}

/* Overlay per il dropdown profilo mobile */
@media (max-width: 768px) {
    .profile-dropdown-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(5px);
        z-index: 2500;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .profile-dropdown-overlay.active {
        display: block;
        opacity: 1;
    }
}

/* Animazioni */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.login-modal {
    animation: fadeIn 0.3s ease;
}

.login-modal.closing {
    animation: fadeOut 0.3s ease forwards;
}

.profile-dropdown {
    animation: fadeIn 0.3s ease;
}

.login-modal.closing {
    animation: fadeOut 0.3s ease;
}
